// *************************************************************************************************
//
// MK3D Engine
// --------------------------------------
// Copyright (C) 2007-2011 Zeb (mailto: zebbey@gmail.com)
//
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//
// *************************************************************************************************

#ifndef __H_MK_UI_RECT__
#define __H_MK_UI_RECT__

namespace MK3DE
{
	struct RectColor
	{
		DWORD leftTop;
		DWORD rightTop;
		DWORD leftBottom;
		DWORD rightBottom;

		RectColor() :
		leftTop(0xffffffff), rightTop(0xffffffff), leftBottom(0xffffffff), rightBottom(0xffffffff)
		{}

		RectColor(DWORD lt, DWORD rt, DWORD lb, DWORD rb) :
		leftTop(lt), rightTop(rt), leftBottom(lb), rightBottom(rb)
		{}

		void SetColor(DWORD color[])
		{
			leftTop = color[0];
			rightTop = color[1];
			leftBottom = color[2];
			rightBottom = color[3];
		}
	};

	struct Rect2D
	{
		D3DXVECTOR2 leftTop;
		D3DXVECTOR2 rightBottom;

		Rect2D() {}
		Rect2D(float x1, float y1, float x2, float y2) : leftTop(x1, y1), rightBottom(x2, y2) {}

		void SetRect(float left, float top, float right, float bottom)
		{
			leftTop.x = left;
			leftTop.y = top;
			rightBottom.x = right;
			rightBottom.y = bottom;
		}

		void SetOffset(float x, float y)
		{
			leftTop.x += x;
			leftTop.y += y;
			rightBottom.x += x;
			rightBottom.y += y;
		}
	};
};

#endif // __H_MK_UI_RECT__